﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage.Master" EnableViewState="true"
    CodeBehind="wfAprobacionOC.aspx.cs" Inherits="CO.wfAprobacionOC" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="DataTable/media/css/demo_page.css" rel="stylesheet" />
    <link href="DataTable/media/css/demo_table_jui.css" rel="stylesheet" />
    <link href="DataTable/examples/examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css" rel="stylesheet" />

    <link href="../Styles/General.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/token-input-facebook.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />

    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>

    <script src="../Scripts/jquery.tokeninput.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.purr.js" type="text/javascript"></script>
    <script src="../Scripts/General.js" type="text/javascript"></script>

    <script src="../Scripts/jquery.MetaData.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.dataTables.min.js" type="text/javascript"></script>

    <%--<script type="text/javascript">
        $(document).ready(function () {
            // Indicar al pluging Metadata que los metadatos deberá buscarlos en el atributo class.
            $.metadata.setType("class");

            $("table.grid").each(function () {
                var grid = $(this);

                // Por cada GridView que se encuentre modificar el código HTML generado para agregar el THEAD.
                if (grid.find("tbody > tr > th").length > 0) {
                    grid.find("tbody").before("<thead><tr></tr></thead>");
                    grid.find("thead:first tr").append(grid.find("th"));
                    grid.find("tbody tr:first").remove();
                }

                // Si el GridView tiene la clase "sortable" aplicar el plugin DataTables si tiene más de 10 elementos.
                if (grid.hasClass("sortable") && grid.find("tbody:first > tr").length > 10) {
                    grid.dataTable({
                        bJQueryUI: true,
                        iDisplayLength: 20,
                        sScrollY: "100%",
                        sPaginationType: "full_numbers",
                        aoColumnDefs: [
                            { bSortable: false, aTargets: grid.metadata().disableSortCols }
                        ]
                    });
                }
            });

        });
    </script>--%>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <input id="dummy" type="button" style="display: none" runat="server" />

    <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional">
        <ContentTemplate>
            <table width="100%" cellpadding="0" cellspacing="2">
                <tr>
                    <td colspan="3">
                        <div class="modalPopupHeader">
                            &nbsp;&nbsp;&nbsp;<asp:Label ID="lblTitlePopup" runat="server"></asp:Label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">&nbsp;
                    </td>
                    <td>
                        <table width="100%" cellpadding="0" cellspacing="2">
                            <tr>
                                <td>
                                    <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                                        <table width="100%" cellpadding="0" cellspacing="2">
                                            <tr>
                                                <td style="width: 5px;">&nbsp;
                                                </td>
                                                <td class="style22">Fecha Inicio
                                                </td>
                                                <td class="style27">
                                                    <%--<uc1:ucControlFecha ID="ucControlFecha1" runat="server" />--%>
                                                    <esd:esdDateTextBox ID="ucControlFecha1" runat="server" />

                                                </td>
                                                <td style="margin-left: 40px;" class="style16">
                                                    <asp:TextBox ID="TextBox1" runat="server" BorderStyle="None" Enabled="False"
                                                        Height="15px" Width="20px"></asp:TextBox>
                                                    <br />
                                                </td>
                                                <td class="style26">
                                                    <asp:CheckBox ID="chkPendiente" runat="server" Text="Pendiente" />
                                                </td>
                                                <td>&nbsp;</td>
                                                <td style="width: 10px;">Planta

                                                </td>
                                                <td class="style30">

                                                    <asp:DropDownList ID="dbPlanta" runat="server" Width="200px"
                                                        AutoPostBack="True">
                                                    </asp:DropDownList>

                                                </td>
                                                <td>
                                                    <asp:Button ID="btnBuscar" runat="server" CssClass="esdButtonStyle" Text="Buscar" Width="80px" OnClick="btnBuscar_Click" />
                                                </td>
                                                <td>&nbsp;</td>
                                                <td style="width: 5px;">&nbsp;<asp:Button ID="btnAprobar" runat="server" CssClass="esdButtonStyle"
                                                    Text="Aprobar" Width="80px" OnClick="btnAprobar_Click" />
                                                </td>
                                            </tr>


                                            <tr>
                                                <td class="style4"></td>
                                                <td class="style20">Fecha Fin</td>
                                                <td class="style28">
                                                    <%--<uc1:ucControlFecha ID="ucControlFecha2" runat="server" />--%>
                                                    <esd:esdDateTextBox ID="ucControlFecha2" runat="server" />
                                                </td>
                                                <td class="style16" style="margin-left: 40px;">
                                                    <asp:TextBox ID="TextBox2" runat="server" BackColor="#CCCCCC"
                                                        BorderStyle="None" Enabled="False" Height="15px" Width="20px"></asp:TextBox>
                                                </td>
                                                <td class="style13">
                                                    <asp:CheckBox ID="chk_nAutoriza" runat="server" Text="No autorizar" />
                                                </td>
                                                <td class="style5"></td>
                                                <td class="style6"></td>
                                                <td class="style5" colspan="2"></td>
                                                <td class="style5"></td>
                                                <td class="style4">
                                                    <asp:Button ID="btnNAprobar" runat="server" CssClass="esdButtonStyle"
                                                        Text="No Autorizar" Width="80px" OnClick="btnNAprobar_Click" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style1"></td>
                                                <td class="style21"></td>
                                                <td class="style29"></td>
                                                <td class="style16" style="margin-left: 40px;">
                                                    <asp:TextBox ID="TextBox3" runat="server" BackColor="#FFCC99"
                                                        BorderStyle="None" Enabled="False" Height="15px" Width="20px"></asp:TextBox>
                                                </td>
                                                <td class="style14">
                                                    <asp:CheckBox ID="chkAutoriza" runat="server" Text="Autorizadas" />
                                                </td>
                                                <td class="style2"></td>
                                                <td class="style3"></td>
                                                <td class="style2" colspan="2"></td>
                                                <td class="style2"></td>
                                                <td class="style1">&nbsp;</td>
                                            </tr>
                                            <tr>
                                                <td style="width: 5px;">&nbsp;</td>
                                                <td class="style22">&nbsp;</td>
                                                <td class="style27">
                                                    <asp:Button ID="btnActualizar" runat="server" CssClass="esdButtonStyle"
                                                        Text="Actualizar" Width="80px" OnClick="btnActualizar_Click" />
                                                </td>
                                                <td class="style16">&nbsp;</td>
                                                <td class="style26">&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td style="width: 10px;">&nbsp;</td>
                                                <td colspan="2">&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td style="width: 5px;">
                                                    <asp:Button ID="btnSalir" runat="server" CssClass="esdButtonStyle"
                                                        Text="Salir" Width="80px" />
                                                </td>
                                            </tr>


                                        </table>

                                    </div>

                                </td>
                            </tr>
                            <caption>
                                <tr align="center">
                                    <td>
                                        <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                                            <table cellpadding="0" cellspacing="2" width="100%">

                                                <tr align="center">
                                                    <div style="overflow: auto; width: 100%">
                                                        <div class="DataDetail">
                                                            <%-- <asp:GridView ID="gvListar" runat="server" AllowPaging="True" 
                                                            AllowSorting="True" AutoGenerateColumns="False" CellPadding="0" 
                                                            GridLines="None" ShowFooter="True" Width="750px" PageSize="20"
                                                                onpageindexchanging="gvListar_PageIndexChanging" >--%>

                                                            <%--<asp:GridView ID="gvListar" runat="server" AutoGenerateColumns="False"  GridLines="None"  CssClass="grid sortable {disableSortCols: [4]}">--%>

                                                                <asp:GridView ID="gvListar" Visible="true" 
                                                                                  EnableSortingAndPagingCallback="True"
                                                                                  AllowPaging="True" AllowSorting="True"
                                                                                  onpageindexchanging="gvListar_PageIndexChanging"
                                                                                  onsorting="gvListar_Sorting"
                                                                                  AutoGenerateColumns ="False" runat="server" PageSize="30" >
                                                                    
                                                                <%--<AlternatingRowStyle CssClass="grid sortable" />--%>
                                                                <Columns>

                                                                    <%--<asp:BoundField DataField="Codigo" HeaderText="Codigo" />--%>

                                                                    <asp:TemplateField HeaderText="id_periodo" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("id_periodo") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="#O/C.">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="lblId_Ordenco" runat="server" Text='<%# Bind("id_ordenco") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Origen OC">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("origen") %>' Width="60px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="#Conso/Req">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("consoreq") %>'
                                                                                Width="80px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="#Cotizacion">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("cotiza") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Condición">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("ds_condpago") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Proveedor">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("ds_raznombre") %>'
                                                                                Width="200px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Prioridad">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label18" runat="server" Text='<%# Bind("priorid") %>'
                                                                                Width="70px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Fecha">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("fe_ordenco") %>'
                                                                                Width="100px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="id_importa" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label9" runat="server" Text='<%# Bind("id_importa") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="fe_entrega" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("fe_entrega") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="id_local" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label11" runat="server" Text='<%# Bind("id_local") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Pedido En">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label12" runat="server" Text='<%# Bind("plantaent") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Emitida Por">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label17" runat="server" Text='<%# Bind("emitidap") %>'
                                                                                Width="150px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Entregar En">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label15" runat="server" Text='<%# Bind("plantapedido") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="pedidop" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label13" runat="server" Text='<%# Bind("pedidop") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="id_local2" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label14" runat="server" Text='<%# Bind("id_local2") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="id_personal2" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label16" runat="server" Text='<%# Bind("id_personal2") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Monto">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label19" runat="server" Text='<%# Bind("mt_total") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="id_modcomp" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label20" runat="server" Text='<%# Bind("id_modcomp") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Mod. Compra">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label21" runat="server" Text='<%# Bind("modcomp") %>'
                                                                                Width="100px"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="tipocomp" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label22" runat="server" Text='<%# Bind("tipocomp") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Mnda">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label23" runat="server" Text='<%# Bind("moneda") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Aprobado Por">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label24" runat="server" Text='<%# Bind("aprobadopor") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="st_aprueba" Visible="False">

                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label25" runat="server" Text='<%# Bind("st_aprueba") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>

                                                                    <asp:TemplateField Visible="true">
                                                                        <ItemTemplate>
                                                                            <asp:CheckBox ID="chkBxSelect" runat="server" Text=" " />
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>

                                                                </Columns>
                                                            <HeaderStyle CssClass="headerStyle" />
                                                            <FooterStyle CssClass="footerStyle" />
                                                            <RowStyle CssClass="rowStyle" />

                                                            </asp:GridView>
                                                        </div>
                                                    </div>
                                                    <td></td>
                                                </tr>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                            </caption>

                        </table>
                    </td>
                    <td style="width: 5px;">&nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">&nbsp;
                    </td>
                    <td align="right"></td>
                    <td style="width: 5px;">&nbsp;
                    </td>
                </tr>

            </table>
        </ContentTemplate>

    </asp:UpdatePanel>


    <asp:HiddenField ID="hdnidCliProv" runat="server" />

</asp:Content>
